home *** CD-ROM | disk | FTP | other *** search
- onClipEvent(enterFrame){
- if(_root.playGame)
- {
- _root.falling = move(0,s);
- if(Key.isDown(32) && !_root.falling && !_root.jumping)
- {
- vel = -12;
- _root.jumping = true;
- _root.bounceSnd.gotoAndPlay(2);
- }
- if(Key.isDown(38) && !_root.falling && !_root.jumping)
- {
- vel = -12;
- _root.jumping = true;
- _root.bounceSnd.gotoAndPlay(2);
- }
- if(Key.isDown(37) and _X > 10)
- {
- move(- s,0);
- this.gotoAndStop(2);
- this.heroClip.nextFrame();
- }
- if(Key.isDown(39) and _X < 490)
- {
- move(s,0);
- this.gotoAndStop(1);
- this.heroClip.nextFrame();
- }
- if(_root.jumping)
- {
- this._rotation = r;
- if(vel <= 12)
- {
- h = move(0,vel - s);
- if(h == false && vel < 0)
- {
- vel *= -1;
- }
- vel++;
- }
- else
- {
- _root.jumping = false;
- }
- }
- }
- if(this._y > 320)
- {
- _root.playGame = false;
- _root.hero.gotoAndStop(3);
- }
- }
-